<template>
  <div>
    <el-tree :data="treeList" :props="treeProps" show-checkbox></el-tree>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { treeListApi } from "./api";

const treeProps = {
  children: "children",
  label: "title",
};

const treeList = ref<ItreeMenu[]>([]);

treeListApi().then((res) => {
  if (res.code === 200) {
    treeList.value = res.data;
  }
});
</script>

<style scoped></style>
